<!DOCTYPE html>
<html>
	<head>
		<title>兑换</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<link rel="stylesheet" type="text/css" href="{:_SKIN}/weixin/sn/css/reset.css"/>
		<link rel="stylesheet" href="{:_SKIN}/weixin/sn/ydui/build/css/ydui.css" />
		<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_400457_mqmlp1g1kh1qyqfr.js"/>
		<script src="{:_SKIN}/weixin/sn/ydui/build/js/ydui.flexible.js"></script>
		<style type="text/css">
			body{background-color:#f4f4f4}
			@font-face{font-family:iconfont;src:url(http://at.alicdn.com/t/font_400457_mqmlp1g1kh1qyqfr.eot);src:url(http://at.alicdn.com/t/font_400457_mqmlp1g1kh1qyqfr.eot?#iefix) format('embedded-opentype'),url(http://at.alicdn.com/t/font_400457_mqmlp1g1kh1qyqfr.woff) format('woff'),url(http://at.alicdn.com/t/font_400457_mqmlp1g1kh1qyqfr.ttf) format('truetype'),url(http://at.alicdn.com/t/font_400457_mqmlp1g1kh1qyqfr.svg#iconfont) format('svg')}
			.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-webkit-text-stroke-width:.2px;-moz-osx-font-smoothing:grayscale}
			.shop-0{height:54px;background:#15ce67;line-height:54px;color:#FFF;text-align:center}
			.xw_90{width:90%;margin:0 auto}
			.xw_90 h3{font-size:18px}
			.neilian{display:inline}
			.zuo{float:left}
			.you{float:right}
			.btn1{background-color:#15ce67;color:#FFF;border-radius:4px}
			.btn2{color:#15ce67;background-color:#FFF;border-radius:4px;border:1px solid #15ce67}
			.fom{padding:30px 20px}
			.pp{color:#a4a4a4;font-size:12px}
			.font{font-size: 22px;}

		</style>
	</head>
	<body>
		<div class="shop-0">
	<div class="xw_90">
		<a href="javascript:history.go(-1)"><i class="iconfont zuo font">&#xe664;</i></a>
		<h3 class="neilian">礼品卡充值</h3>
		<a href="{:url('my/index')}"><i class="icon-home-outline you font"></i></a>
	</div>
</div>

<div class="fom">
	<form action="">
		<div class="m-cell">
			<div class="cell-item">
				<div class="cell-left">
					卡号：
				</div>
				<div class="cell-right">
					<input type="number" id="sn" class="cell-input" maxlength="8" placeholder="请输入充值卡号">
				</div>
			</div>
			<div class="cell-item">
				<div class="cell-left">
					密码：
				</div>
				<div class="cell-right">
					<input type="number" id="pwd" class="cell-input" maxlength="8" placeholder="请输入充值密码">
				</div>
			</div>
		</div>
		<p class="pp">
			礼品卡充值成功后，可以在兑换商城购买等价礼品，该卡不可提现，有效期为3个月。
		</p>
		<div class="m-button">
			<input type="button" class="btn-block btn1" id="J_ToastS" value="确认充值"><input type="button" class="btn-block btn2" id="J_ToastE" value="点击取消">
		</div>
	</form>
</div>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="{:_SKIN}/weixin/sn/ydui/build/js/ydui.js"></script>
			
<!--弹出框-->	
<script type="text/javascript">
				 
 !function(win, $) {
 	var dialog = win.YDUI.dialog;
 	/* 正确提示框 */
 	$('#J_ToastS').on('click', function() {



 		var data={sn:$("#sn").val(),pwd:$("#pwd").val()};
        if(data.sn.length==8 && data.pwd.length==8){

dialog.loading.open('加载中');
          
          $.post(' ',data,function(res){


          	if(res.code==200){
          		 dialog.loading.close();
                
          		
          		 dialog.alert(res.msg,function(){
                   dialog.loading.open();
                   window.location.href="{:url('my/wallet')}";

          		 });
          		 


          	}else{

                 dialog.loading.close();
          		dialog.toast(res.msg, 'error', 1000);
          	}


          });



        }else{

          
          dialog.toast('请输入正确的卡号和密码', 'error', 1000);

        }
 		

 		//dialog.toast('充值成功', 'success', 1000);





 	});

 	/* 错误提示框 */
 	$('#J_ToastE').on('click', function() {
 		dialog.toast('已取消', 'error', 1000);
 	});


 }(window, jQuery);

</script>
	</body>
</html>
